package work20240723;

import java.util.ArrayList;

public class work6 {
    public static void main(String[] args) {
        removeArr();
    }
    public static void removeArr() {
        int[] a1 = {1,2,3};
        int[] a2 = {3,4,5,2};
        ArrayList<Integer> arr = new ArrayList<>();
        for(int i = 0;i < a1.length;i++){
           arr.add(a1[i]);
        }
        for(int j = 0;j < a2.length;j++){
            if(arr.contains(a2[j])){
                arr.remove(arr.indexOf(a2[j]));
            } else {
                arr.add(a2[j]);
            }
        }
        System.out.println(arr);
    }
}
